<?php
/*
 *	  listedit.php
 *
 *	  Copyright 2010 Rakitin Vitaliy <virak@ukr.net>
 *
 *	  This program is free software; you can redistribute it and/or modify
 *	  it under the terms of the GNU General Public License as published by
 *	  the Free Software Foundation; either version 2 of the License, or
 *	  (at your option) any later version.
 *
 *	  This program is distributed in the hope that it will be useful,
 *	  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	  GNU General Public License for more details.
 *
 *	  You should have received a copy of the GNU General Public License
 *	  along with this program; if not, write to the Free Software
 *	  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *	  MA 02110-1301, USA.
 */
 //require_once($_SERVER['DOCUMENT_ROOT']."/classes/GUI/nwmsg.php");
 
require_once($_SERVER['DOCUMENT_ROOT']."/metadata/iobserver.php");
require_once($_SERVER['DOCUMENT_ROOT']."/classes/System/ostabular.php");

class listedit implements iobserver {
	
	private $uuid;
	private $object = null;
	//private $visible = true;

	function __construct() {
		$this->uuid = genUUID();
		$_SESSION[$this->uuid] = &$this;
	}

	function get() {
/*
		if ($this->field) {
			$out = "<input id='$this->uuid' type='text' name='edit' size='36' value='".htmlspecialchars($this->field->value,ENT_QUOTES)."' onchange=message('$this->uuid','onchange',encodeURIComponent(this.value),0);>";
		} else {
			$out = "<input id='$this->uuid' type='text' name='edit' size='36' disable='disable' value=''>";
		}
*/
		$out = "Here is tabular<br>";
		return $out;
	}

/*
	function onchange($value) {
		$this->field->value = $value;
	}
*/
	
	function observable_before_changed( $sender, &$args ) {
	//	$this->update();
	}
	
	function observable_after_changed( $sender, &$args ) {
		//$this->update();
	}
	
	function __set($name, $value) {
		if (($name == "object") && ($value instanceof ostabular)) {
			$this->object = $value;
			//$this->object->addObserver($this);
		}
	}
	
	function close() {
		unset($_SESSION[$this->uuid]);
	}

/*
	function update() {
		$answer = &$_SESSION['answer'];
		$answer[] = array('modify',$this->uuid,'value',$this->field->value);
	}
*/

}
?>
